<?
/* 	These code was generated using phpCIGen v 0.1.a (21/04/2009)
	#zaqi 		zaqi.smart@gmail.com,http://zenzaqi.blogspot.com, 
    #songbee	mukhlisona@gmail.com
	#CV. Trust Solution, jl. Saronojiwo 19 Surabaya, http://www.ts.co.id
	
	+ Module  		: Ganti Password View
	+ Description	: For record view
	+ Filename 		: V_gpass.php
 	+ Author  		: 
 	+ Created on 01/May/2009 06:35:27
	
*/
?>
<div id="welcome">
	<style type="text/css">
        p { width:650px; }
		.search-item {
			font:normal 11px tahoma, arial, helvetica, sans-serif;
			padding:3px 10px 3px 10px;
			border:1px solid #fff;
			border-bottom:1px solid #eeeeee;
			white-space:normal;
			color:#555;
		}
		.search-item h3 {
			display:block;
			font:inherit;
			font-weight:bold;
			color:#222;
		}
		
		.search-item h3 span {
			float: right;
			font-weight:normal;
			margin:0 0 5px 5px;
			width:100px;
			display:block;
			clear:none;
		}
    </style>
<script>

var update_Button;
var update_Form;
var update_Window;

Ext.onReady(function(){
  Ext.QuickTips.init();

	function fix_bug(){

		if(Ext.getCmp('form-file').getValue()!==""){
					
					Ext.MessageBox.show({
						msg: 'Sedang meng-update system, silakan tunggu...',
						progressText: 'Loading...',
						width:350,
						wait:true,
						icon:'icon-sync'
					});

					
					update_Form.getForm().submit({
						method: 'POST',
						waitTitle:'Please wait.....',
						waitMsg:'Proses Upload...',
						clientValidation: true,
						timeOut: 36000,
						url: 'index.php?c=c_update&m=fix_bug',
						success: function(form, action) {
							Ext.Msg.alert('Success', "Update system berhasil ");
						},
						failure: function(form, action) {
							 switch (action.failureType) {
							     case Ext.form.Action.CLIENT_INVALID:
								 Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
								 break;
							     case Ext.form.Action.CONNECT_FAILURE:
								 Ext.Msg.alert('Failure', 'Ajax communication failed');
								 break;
							     case Ext.form.Action.SERVER_INVALID:
								Ext.Msg.alert('Failure', action.result.msg);
							}
						}
					});
					
			} else {
				Ext.MessageBox.show({
					title: 'Warning',
					msg: 'Isian Form belum lengkap',
					buttons: Ext.MessageBox.OK,
					animEl: 'save',
					icon: Ext.MessageBox.WARNING
				});
			}
	}
	
	
	update_Button=new Ext.Button({
		text: "Update",
		tooltip: "Update System",
		iconCls:'icon-update',
		handler: fix_bug
	});
	
	update_Form = new Ext.FormPanel({
		labelAlign: 'left',
		bodyStyle:'padding:5px',
		width: 450, 
		fileUpload: true,
		autoHeight: true,
		items: [{xtype: 'fileuploadfield', 
			id: 'form-file', 
			emptyText: 'Select an file', 
			fieldLabel: 'Nama File', 
			width: 300,
			labelWidth: 50,
			name: 'namaFile'
			},update_Button]
		
	});
	
	/* Form Advanced Search */
	update_Window = new Ext.Window({
		title: 'Update System',
		closable:false,
		closeAction: 'hide',
		width: 460, 
		autoHeight: true,
		plain:true,
		layout: 'fit',
		x: 0,
		y: 0,
		modal: true,
		renderTo: 'elwindow_update',
		items: update_Form
	});
	/* End Function Advanced Search */
	update_Window.show();
	
  	
});
	</script>
	<div class="col">
		<div id="elwindow_update"></div>
    </div>
</div>